Skip to content

TLS: Allow specification of both typed and non-typed san matchers in config#20529

Merged
ggreenway merged 11 commits intoenvoyproxy:mainfrom
pradeepcrao:san_backwards
Apr 25, 2022
Merged

TLS: Allow specification of both typed and non-typed san matchers in config#20529
ggreenway merged 11 commits intoenvoyproxy:mainfrom
pradeepcrao:san_backwards

Conversation

@pradeepcrao
Copy link
Copy Markdown
Contributor

Commit Message:
Additional Description:
Allow configs with both typed and non typed san matchers specified to allow config servers to use the same config for Envoys across multiple versions. The match_subject_alt_names field is ignored if match_typed_subject_alt_names is set.

Risk Level: Low
Testing: Modified test, ran //test/...
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

are provided in config.

Signed-off-by: Pradeep Rao <pcrao@google.com>
Signed-off-by: Pradeep Rao <pcrao@google.com>
@pradeepcrao
Copy link
Copy Markdown
Contributor Author

/assign adisuissa

@suniltheta
Copy link
Copy Markdown
Contributor

Just curious if we can back port this to v1.21 ?

@pradeepcrao
Copy link
Copy Markdown
Contributor Author

Just curious if we can back port this to v1.21 ?

Yes!

adisuissa
adisuissa previously approved these changes Mar 27, 2022
Copy link
Copy Markdown
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@adisuissa
Copy link
Copy Markdown
Contributor

Assigning Greg who also reviewed the original PR (#18628).
/assign @ggreenway

subject_alt_name_matchers(config.match_typed_subject_alt_names().begin(),
config.match_typed_subject_alt_names().end());
// If typed subject alt name matchers are provided in the config, don't check
// for the deprecated non-typed field.
Copy link
Copy Markdown
Member

@soulxu soulxu Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is minor behavior change we should add to release note I think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Could you please take a look?

const envoy::extensions::transport_sockets::tls::v3::CertificateValidationContext& config) {
if (!config.match_typed_subject_alt_names().empty() &&
!config.match_subject_alt_names().empty()) {
throw EnvoyException("SAN-based verification using both match_typed_subject_alt_names and "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we keep a warning message for the user? since we ignore this quietly, the user won't know the match_subject_alt_names was ignored.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Signed-off-by: Pradeep Rao <pcrao@google.com>
Signed-off-by: Pradeep Rao <pcrao@google.com>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #20529 was synchronize by pradeepcrao.

see: more, trace.

@soulxu
Copy link
Copy Markdown
Member

soulxu commented Mar 29, 2022

LGTM except the doc need to be fixed.

@adisuissa
Copy link
Copy Markdown
Contributor

PTAL at CI
/wait

Signed-off-by: Pradeep Rao <pcrao@google.com>
Signed-off-by: Pradeep Rao <pcrao@google.com>
Signed-off-by: Pradeep Rao <pcrao@google.com>
@pradeepcrao
Copy link
Copy Markdown
Contributor Author

@pradeepcrao
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20529 (comment) was created by @pradeepcrao.

see: more, trace.

@soulxu
Copy link
Copy Markdown
Member

soulxu commented Mar 30, 2022

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20529 (comment) was created by @soulxu.

see: more, trace.

@pradeepcrao
Copy link
Copy Markdown
Contributor Author

Is this situation unique, or are there other fields that are handled the same way?

@pradeepcrao any information about this question?

/wait-any

Hi Greg, this was the only one I could find:

// If both :ref:`filter_metadata <envoy_v3_api_field_config.core.v3.Metadata.filter_metadata>`

(note that filter_metadata is not yet deprecated, but the plan is to deprecate it soon as per @yanjunxiang-google)

@ggreenway
Copy link
Copy Markdown
Member

@envoyproxy/api-shepherds can you comment on if this the correct way to handle this from an API perspective? If there's nothing unique about this situation, how has this been handled for other similar issues?

/wait-any

Signed-off-by: Pradeep Rao <pcrao@google.com>
@pradeepcrao
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20529 (comment) was created by @pradeepcrao.

see: more, trace.

@htuch
Copy link
Copy Markdown
Member

htuch commented Apr 21, 2022

@ggreenway I think this is a common pattern (introduce new field which is effectively oneof, prefer one over the other), but there are also places where you see both fields continuing to be used, e.g. verify_certificate_{spki,hash}. I think as long as you can set both, and prefer the most correct/safest/etc, you enable safe rollouts.

Copy link
Copy Markdown
Member

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good; release notes have issues.

/wait

----------------------
*Changes that may cause incompatibilities for some users, but should not for most*

* access_log: log all header values in the grpc access log.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong here; I think you picked up a bunch of entries during a bad merge or something.

* sip-proxy: add customized affinity support by adding :ref:`tra_service_config <envoy_v3_api_msg_extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceConfig>` and :ref:`customized_affinity <envoy_v3_api_msg_extensions.filters.network.sip_proxy.v3alpha.CustomizedAffinity>`.
* sip-proxy: add support for the ``503`` response code. When there is something wrong occurred, send ``503 Service Unavailable`` back to downstream.
* stateful session http filter: only enable cookie based session state when request path matches the configured cookie path.
* tls: if both :ref:`match_subject_alt_names <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.match_subject_alt_names>` and :ref:`match_typed_subject_alt_names <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.match_typed_subject_alt_names>` are specified, the former (deprecated) field is ignored.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note the previous behavior (that this was an error).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, PTAL.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New text looks good, but you're still adding 50 entries to the release notes. Please fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed that. Must've have happened because of the 1.22 release. Done now.

Signed-off-by: Pradeep Rao <pcrao@google.com>
Signed-off-by: Pradeep Rao <pcrao@google.com>
@phlax
Copy link
Copy Markdown
Member

phlax commented Apr 25, 2022

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20529 (comment) was created by @phlax.

see: more, trace.

Copy link
Copy Markdown
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!
/lgtm api

@ggreenway ggreenway merged commit ef08b1c into envoyproxy:main Apr 25, 2022
@pradeepcrao
Copy link
Copy Markdown
Contributor Author

@ggreenway Do I have your approval to backport this to 1.21 and 1.22?

ggreenway pushed a commit that referenced this pull request May 16, 2022
…config (#21165)

Backport of #20529

Signed-off-by: Pradeep Rao <pcrao@google.com>
ggreenway pushed a commit that referenced this pull request May 16, 2022
…config (#21170)

Backport of #20529

Signed-off-by: Pradeep Rao <pcrao@google.com>
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
…config (envoyproxy#20529)

Allow configs with both typed and non typed san matchers specified to allow config servers to use the same config for Envoys across multiple versions. The match_subject_alt_names field is ignored if match_typed_subject_alt_names is set.

Signed-off-by: Pradeep Rao <pcrao@google.com>
@phlax phlax removed the backport/review Request to backport to stable releases label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants